Page({
  data: {
    doctor: null,
    index: 0,
    userId: null,
    list0: [
      {
        location: '取药处',
        description: '取药，到门诊1楼西药房及中药房。'
      },
      {
        location: '门诊5楼妇科手术室',
        description: '做妇科小手术、阴道镜。'
      },
      {
        location: '内科楼3楼病理科',
        description: '查TCT、病理组织，到内科楼（门诊对面楼）3楼病理科。'
      },
      {
        location: '门诊2楼检验科',
        description: '查白带、HPV、尿液、抽血等。'
      }
    ],
    list1: [
      {
        content: '女人来月经可以性生活吗'
      },
      {
        content: '女人什么时候绝经正常'
      },
      {
        content: '排除蛋清白带多久排卵'
      },
      {
        content: '排卵期出血一般几天'
      },
      {
        content: '流产后血多久干净'
      },
    ]
  },
  onShow(){
    let doctors = getApp().globalData.doctors;
    let userId = getApp().globalData.userId;
    this.setData({doctor: doctors[1], userId: userId});
  },
  toKnowledge(){
    this.setData({index: 1});
    const query = this.createSelectorQuery();
    query.select('.switch-area').node();
    query.exec(([{ node: scrollview }]) => {
      scrollview.scrollIntoView('.info');
    });
  },
  toWarn(){
    this.setData({index: 0});
    const query = this.createSelectorQuery();
    query.select('.switch-area').node();
    query.exec(([{ node: scrollview }]) => {
      scrollview.scrollIntoView('.warn');
    });
  },
  onScrollEnd(e){
    console.log(e.detail.scroll-left);
  }
})